<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>javascript</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box
    }
    body {
      font-size: 14px;
      padding: 20px;
    }
    ul li {
      line-height: 30px;
    }
  </style>
</head>
<body>
  <ul>
    <li></li>
  </ul>
</body>
<script src="https://cdn.bootcss.com/vue/2.6.8/vue.js"></script>
<script>
  var  str = String(74);
  let arr = []
  function getArr() {
    let arr = [], total = 0;
    for (let i = 0, l = str.length; i < l; i++) {
      arr.push(str.substr(i, 1));
    }
    let nArr = arr.reverse();
    for (let j = 0, l = nArr.length; j < l; j++) {
      total += nArr[j] * (Math.pow(8, j));
    }
    return total
  }
  console.log(getArr())
  var str1 = 12;
  // 12/2 6 0
  // 6/2 3
</script>
</html>